/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.mensageiro.control;

import br.com.mensageiro.visual.Principal;

/**
 *
 * @author Danilo Dorotheu
 */
public class Status implements Runnable{
    private Principal p;
    private Kernel nucleo;
            
    public Status(Principal p, Kernel nucleo)
    {
        this.p = p;
        this.nucleo = nucleo;
    }
    
    @Override
    public void run() {
        while(true)
        {
            if(nucleo.verificaStatus())
            {
                p.txtStatus.setText("Conectado");
            }else
            {
                p.txtStatus.setText("Desconectado");
                nucleo.inicializaCom();
            }
        }
    }
    
}
